package main

import (
	"fmt"
	"os"
	"strings"
)

func main() {

	for _, v := range os.Args[1:] {
		commands := strings.Split(strings.TrimLeft(v, "-"), "=")
		if len(commands) > 1 {
			handleCommand(commands[0], commands[1])
		} else {
			handleCommand(commands[0], "")
		}
	}

}

func handleCommand(command, param string) {

	switch command {
	case "h":
		handleHelp()
		break
	case "ot":
		handleOt(param)
		break
	case "c":
		handleUploadDCdnCert(param)
	default:
		fmt.Println("command not found! input -h show help info.")
	}

}
